home *** CD-ROM | disk | FTP | other *** search
- /* $VER: UserList.rexx 1.0 */
-
- options results
-
- signal on BREAK_C
- signal on BREAK_D
- signal on BREAK_E
- signal on BREAK_F
- signal on ERROR
- signal on HALT
- signal on IOERR
- signal on SYNTAX
-
- /*** Init ***/
-
- call addlib("rexxdossupport.library", 0, -30)
- call addlib("ums.library", 0, -210, 11)
- call UMSInitConsts()
-
- /*** Arguments ***/
-
- parse SOURCE . " " . " " ProgramName .
- ArgsTemplate = "NAME/A,PASSWORD"
- args.SERVER = ""
- args.PASSWORD = ""
-
- parse arg arguments
- if strip(arguments) = '?' then do
- call writech(STDOUT, ArgsTemplate || ': ')
- arguments = readln(STDIN)
- end; else nop
- if ~ReadArgs(arguments,ArgsTemplate,"args.") then do
- say Fault(RC, ProgramName)
- exit 10
- end; else nop
-
- /*** Login ***/
-
- account = UMSLogin(args.name, args.password, args.server)
- if account = 0 then do
- say "unable to login."
- exit 20
- end
-
- /*** Do the magic ***/
-
- user = ""
- do forever
- user = UMSNextUser(account, user)
- if user = "" then leave
- say user
- end
-
-
- /*** Final cleanup ***/
-
- BREAK_C:
- BREAK_D:
- BREAK_E:
- BREAK_F:
-
- RC = 0
-
- ERROR:
- HALT:
- IOERR:
- SYNTAX:
-
- IF RC ~= 0 THEN DO
- SAY "Error: " rc errortext(rc) "Line" sigl
- rc = 20
- END
-
- /*** Logout ***/
-
- LOGOUT:
-
- if account ~= 0 then do
- call UMSLogout(account)
- account = 0
- end
-
- exit rc
-